package com.ruoyi.bantong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bantong.mapper.BtUserTicketMapper;
import com.ruoyi.bantong.domain.BtUserTicket;
import com.ruoyi.bantong.service.IBtUserTicketService;

/**
 * 用户奖券Service业务层处理
 * 
 * @author laohei
 * @date 2021-01-27
 */
@Service
public class BtUserTicketServiceImpl implements IBtUserTicketService 
{
    @Autowired
    private BtUserTicketMapper btUserTicketMapper;

    /**
     * 查询用户奖券
     * 
     * @param utId 用户奖券ID
     * @return 用户奖券
     */
    @Override
    public BtUserTicket selectBtUserTicketById(Integer utId)
    {
        return btUserTicketMapper.selectBtUserTicketById(utId);
    }

    /**
     * 查询用户奖券列表
     * 
     * @param btUserTicket 用户奖券
     * @return 用户奖券
     */
    @Override
    public List<BtUserTicket> selectBtUserTicketList(BtUserTicket btUserTicket)
    {
        return btUserTicketMapper.selectBtUserTicketList(btUserTicket);
    }

    /**
     * 新增用户奖券
     * 
     * @param btUserTicket 用户奖券
     * @return 结果
     */
    @Override
    public int insertBtUserTicket(BtUserTicket btUserTicket)
    {
        btUserTicket.setCreateTime(DateUtils.getNowDate());
        return btUserTicketMapper.insertBtUserTicket(btUserTicket);
    }

    /**
     * 修改用户奖券
     * 
     * @param btUserTicket 用户奖券
     * @return 结果
     */
    @Override
    public int updateBtUserTicket(BtUserTicket btUserTicket)
    {
        btUserTicket.setUpdateTime(DateUtils.getNowDate());
        btUserTicket.setUpdateBy(SecurityUtils.getUsername());
        return btUserTicketMapper.updateBtUserTicket(btUserTicket);
    }

    /**
     * 批量删除用户奖券
     * 
     * @param utIds 需要删除的用户奖券ID
     * @return 结果
     */
    @Override
    public int deleteBtUserTicketByIds(Integer[] utIds)
    {
        return btUserTicketMapper.deleteBtUserTicketByIds(utIds);
    }

    /**
     * 删除用户奖券信息
     * 
     * @param utId 用户奖券ID
     * @return 结果
     */
    @Override
    public int deleteBtUserTicketById(Integer utId)
    {
        return btUserTicketMapper.deleteBtUserTicketById(utId);
    }
}
